home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Grafik & Text / OzTeX3.0 / BibTeX / BibTeX inputs / aaai-named.bst next >
Text File  |  1996-02-11  |  23KB  |  1,283 lines

  1. % BibTeX `aaai-named' style file for BibTeX version 0.99c, LaTeX version 2.09
  2. % This version was made by modifying the master file made by
  3. % Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU)
  4.  
  5. % Copyright (C) 1985, all rights reserved.
  6. % Modifications Copyright 1988, Peter F. Patel-Schneider
  7. % Copying of this file is authorized only if either
  8. % (1) you make absolutely no changes to your copy, including name, or
  9. % (2) if you do make changes, you name it something other than
  10. % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  11. % This restriction helps ensure that all standard styles are identical.
  12.  
  13. % There are undoubtably bugs in this style.  If you make bug fixes,
  14. % improvements, etc.  please let me know.  My e-mail address is:
  15. %    pfps@spar.slb.com
  16.  
  17. %   Citation format: [author-last-name, year]
  18. %             [author-last-name and author-last-name, year]
  19. %             [author-last-name {\em et al.}, year]
  20. %
  21. %   Reference list ordering: alphabetical by author or whatever passes
  22. %    for author in the absence of one.
  23. %
  24. % This BibTeX style has support for short (year only) citations.  This
  25. % is done by having the citations actually look like
  26. %         \citename{name-info, }year
  27. % The LaTeX style has to have the following
  28. %     \let\@internalcite\cite
  29. %     \def\cite{\def\citename##1{##1}\@internalcite}
  30. %     \def\shortcite{\def\citename##1{}\@internalcite}
  31. %     \def\@biblabel#1{\def\citename##1{##1}[#1]\hfill}
  32. % which makes \shortcite the macro for short citations.
  33.  
  34. ENTRY
  35.   { address
  36.     author
  37.     booktitle
  38.     chapter
  39.     edition
  40.     editor
  41.     howpublished
  42.     institution
  43.     journal
  44.     key
  45.     month
  46.     note
  47.     number
  48.     organization
  49.     pages
  50.     publisher
  51.     school
  52.     series
  53.     title
  54.     type
  55.     volume
  56.     year
  57.   }
  58.   {}
  59.   { label extra.label sort.label }
  60.  
  61. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  62.  
  63. FUNCTION {init.state.consts}
  64. { #0 'before.all :=
  65.   #1 'mid.sentence :=
  66.   #2 'after.sentence :=
  67.   #3 'after.block :=
  68. }
  69.  
  70. STRINGS { s t }
  71.  
  72. FUNCTION {output.nonnull}
  73. { 's :=
  74.   output.state mid.sentence =
  75.     { ", " * write$ }
  76.     { output.state after.block =
  77.     { add.period$ write$
  78.       newline$
  79.       "\newblock " write$
  80.     }
  81.     { output.state before.all =
  82.         'write$
  83.         { add.period$ " " * write$ }
  84.       if$
  85.     }
  86.       if$
  87.       mid.sentence 'output.state :=
  88.     }
  89.   if$
  90.   s
  91. }
  92.  
  93. FUNCTION {output}
  94. { duplicate$ empty$
  95.     'pop$
  96.     'output.nonnull
  97.   if$
  98. }
  99.  
  100. FUNCTION {output.check}
  101. { 't :=
  102.   duplicate$ empty$
  103.     { pop$ "empty " t * " in " * cite$ * warning$ }
  104.     'output.nonnull
  105.   if$
  106. }
  107.  
  108. FUNCTION {output.bibitem}
  109. { newline$
  110.  
  111.   "\bibitem[" write$
  112.   label write$
  113.   "]{" write$
  114.  
  115.   cite$ write$
  116.   "}" write$
  117.   newline$
  118.   ""
  119.   before.all 'output.state :=
  120. }
  121.  
  122. FUNCTION {fin.entry}
  123. { add.period$
  124.   write$
  125.   newline$
  126. }
  127.  
  128. FUNCTION {new.block}
  129. { output.state before.all =
  130.     'skip$
  131.     { after.block 'output.state := }
  132.   if$
  133. }
  134.  
  135. FUNCTION {new.sentence}
  136. { output.state after.block =
  137.     'skip$
  138.     { output.state before.all =
  139.     'skip$
  140.     { after.sentence 'output.state := }
  141.       if$
  142.     }
  143.   if$
  144. }
  145.  
  146. FUNCTION {not}
  147. {   { #0 }
  148.     { #1 }
  149.   if$
  150. }
  151.  
  152. FUNCTION {and}
  153. {   'skip$
  154.     { pop$ #0 }
  155.   if$
  156. }
  157.  
  158. FUNCTION {or}
  159. {   { pop$ #1 }
  160.     'skip$
  161.   if$
  162. }
  163.  
  164. FUNCTION {new.block.checka}
  165. { empty$
  166.     'skip$
  167.     'new.block
  168.   if$
  169. }
  170.  
  171. FUNCTION {new.block.checkb}
  172. { empty$
  173.   swap$ empty$
  174.   and
  175.     'skip$
  176.     'new.block
  177.   if$
  178. }
  179.  
  180. FUNCTION {new.sentence.checka}
  181. { empty$
  182.     'skip$
  183.     'new.sentence
  184.   if$
  185. }
  186.  
  187. FUNCTION {new.sentence.checkb}
  188. { empty$
  189.   swap$ empty$
  190.   and
  191.     'skip$
  192.     'new.sentence
  193.   if$
  194. }
  195.  
  196. FUNCTION {field.or.null}
  197. { duplicate$ empty$
  198.     { pop$ "" }
  199.     'skip$
  200.   if$
  201. }
  202.  
  203. FUNCTION {emphasize}
  204. { duplicate$ empty$
  205.     { pop$ "" }
  206.     { "{\em " swap$ * "}" * }
  207.   if$
  208. }
  209.  
  210. INTEGERS { nameptr namesleft numnames }
  211.  
  212. FUNCTION {format.names}
  213. { 's :=
  214.   #1 'nameptr :=
  215.   s num.names$ 'numnames :=
  216.   numnames 'namesleft :=
  217.     { namesleft #0 > }
  218.  
  219.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  220.  
  221.       nameptr #1 >
  222.     { namesleft #1 >
  223.         { ", " * t * }
  224.         { numnames #2 >
  225.         { "," * }
  226.         'skip$
  227.           if$
  228.           t "others" =
  229.         { " et~al." * }
  230.         { " and " * t * }
  231.           if$
  232.         }
  233.       if$
  234.     }
  235.     't
  236.       if$
  237.       nameptr #1 + 'nameptr :=
  238.       namesleft #1 - 'namesleft :=
  239.     }
  240.   while$
  241. }
  242.  
  243. FUNCTION {format.authors}
  244. { author empty$
  245.     { "" }
  246.     { author format.names }
  247.   if$
  248. }
  249.  
  250. FUNCTION {format.editors}
  251. { editor empty$
  252.     { "" }
  253.     { editor format.names
  254.       editor num.names$ #1 >
  255.     { ", editors" * }
  256.     { ", editor" * }
  257.       if$
  258.     }
  259.   if$
  260. }
  261.  
  262. FUNCTION {format.title}
  263. { title empty$
  264.     { "" }
  265.  
  266.     { title "t" change.case$ }
  267.  
  268.   if$
  269. }
  270.  
  271. FUNCTION {n.dashify}
  272. { 't :=
  273.   ""
  274.     { t empty$ not }
  275.     { t #1 #1 substring$ "-" =
  276.     { t #1 #2 substring$ "--" = not
  277.         { "--" *
  278.           t #2 global.max$ substring$ 't :=
  279.         }
  280.         {   { t #1 #1 substring$ "-" = }
  281.         { "-" *
  282.           t #2 global.max$ substring$ 't :=
  283.         }
  284.           while$
  285.         }
  286.       if$
  287.     }
  288.     { t #1 #1 substring$ *
  289.       t #2 global.max$ substring$ 't :=
  290.     }
  291.       if$
  292.     }
  293.   while$
  294. }
  295.  
  296. FUNCTION {format.date}
  297. { year empty$
  298.     { month empty$
  299.     { "" }
  300.     { "there's a month but no year in " cite$ * warning$
  301.       month
  302.     }
  303.       if$
  304.     }
  305.     { month empty$
  306.     'year
  307.     { month " " * year * }
  308.       if$
  309.     }
  310.   if$
  311. }
  312.  
  313. FUNCTION {format.btitle}
  314. { title emphasize
  315. }
  316.  
  317. FUNCTION {tie.or.space.connect}
  318. { duplicate$ text.length$ #3 <
  319.     { "~" }
  320.     { " " }
  321.   if$
  322.   swap$ * *
  323. }
  324.  
  325. FUNCTION {either.or.check}
  326. { empty$
  327.     'pop$
  328.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  329.   if$
  330. }
  331.  
  332. FUNCTION {format.bvolume}
  333. { volume empty$
  334.     { "" }
  335.     { "volume" volume tie.or.space.connect
  336.       series empty$
  337.     'skip$
  338.     { " of " * series emphasize * }
  339.       if$
  340.       "volume and number" number either.or.check
  341.     }
  342.   if$
  343. }
  344.  
  345. FUNCTION {format.number.series}
  346. { volume empty$
  347.     { number empty$
  348.     { series field.or.null }
  349.     { output.state mid.sentence =
  350.         { "number" }
  351.         { "Number" }
  352.       if$
  353.       number tie.or.space.connect
  354.       series empty$
  355.         { "there's a number but no series in " cite$ * warning$ }
  356.         { " in " * series * }
  357.       if$
  358.     }
  359.       if$
  360.     }
  361.     { "" }
  362.   if$
  363. }
  364.  
  365. FUNCTION {format.edition}
  366. { edition empty$
  367.     { "" }
  368.     { output.state mid.sentence =
  369.     { edition "l" change.case$ " edition" * }
  370.     { edition "t" change.case$ " edition" * }
  371.       if$
  372.     }
  373.   if$
  374. }
  375.  
  376. INTEGERS { multiresult }
  377.  
  378. FUNCTION {multi.page.check}
  379. { 't :=
  380.   #0 'multiresult :=
  381.     { multiresult not
  382.       t empty$ not
  383.       and
  384.     }
  385.     { t #1 #1 substring$
  386.       duplicate$ "-" =
  387.       swap$ duplicate$ "," =
  388.       swap$ "+" =
  389.       or or
  390.     { #1 'multiresult := }
  391.     { t #2 global.max$ substring$ 't := }
  392.       if$
  393.     }
  394.   while$
  395.   multiresult
  396. }
  397.  
  398. FUNCTION {format.pages}
  399. { pages empty$
  400.     { "" }
  401.     { pages multi.page.check
  402.     { "pages" pages n.dashify tie.or.space.connect }
  403.     { "page" pages tie.or.space.connect }
  404.       if$
  405.     }
  406.   if$
  407. }
  408.  
  409. FUNCTION {format.vol.num.pages}
  410. { volume field.or.null
  411.   number empty$
  412.     'skip$
  413.     { "(" number * ")" * *
  414.       volume empty$
  415.     { "there's a number but no volume in " cite$ * warning$ }
  416.     'skip$
  417.       if$
  418.     }
  419.   if$
  420.   pages empty$
  421.     'skip$
  422.     { duplicate$ empty$
  423.     { pop$ format.pages }
  424.     { ":" * pages n.dashify * }
  425.       if$
  426.     }
  427.   if$
  428. }
  429.  
  430. FUNCTION {format.chapter.pages}
  431. { chapter empty$
  432.     'format.pages
  433.     { type empty$
  434.     { "chapter" }
  435.     { type "l" change.case$ }
  436.       if$
  437.       chapter tie.or.space.connect
  438.       pages empty$
  439.     'skip$
  440.     { ", " * format.pages * }
  441.       if$
  442.     }
  443.   if$
  444. }
  445.  
  446. FUNCTION {format.in.ed.booktitle}
  447. { booktitle empty$
  448.     { "" }
  449.     { editor empty$
  450.     { "In " booktitle emphasize * }
  451.     { "In " format.editors * ", " * booktitle emphasize * }
  452.       if$
  453.     }
  454.   if$
  455. }
  456.  
  457. FUNCTION {empty.misc.check}
  458. { author empty$ title empty$ howpublished empty$
  459.   month empty$ year empty$ note empty$
  460.   and and and and and
  461.  
  462.   key empty$ not and
  463.  
  464.     { "all relevant fields are empty in " cite$ * warning$ }
  465.     'skip$
  466.   if$
  467. }
  468.  
  469. FUNCTION {format.thesis.type}
  470. { type empty$
  471.     'skip$
  472.     { pop$
  473.       type "t" change.case$
  474.     }
  475.   if$
  476. }
  477.  
  478. FUNCTION {format.tr.number}
  479. { type empty$
  480.     { "Technical Report" }
  481.     'type
  482.   if$
  483.   number empty$
  484.     { "t" change.case$ }
  485.     { number tie.or.space.connect }
  486.   if$
  487. }
  488.  
  489. FUNCTION {format.article.crossref}
  490. { key empty$
  491.     { journal empty$
  492.     { "need key or journal for " cite$ * " to crossref " * crossref *
  493.       warning$
  494.       ""
  495.     }
  496.     { "In {\em " journal * "\/}" * }
  497.       if$
  498.     }
  499.     { "In " key * }
  500.   if$
  501.   " \cite{" * crossref * "}" *
  502. }
  503.  
  504. FUNCTION {format.crossref.editor}
  505. { editor #1 "{vv~}{ll}" format.name$
  506.   editor num.names$ duplicate$
  507.   #2 >
  508.     { pop$ " et~al." * }
  509.     { #2 <
  510.     'skip$
  511.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  512.         { " et~al." * }
  513.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  514.       if$
  515.     }
  516.       if$
  517.     }
  518.   if$
  519. }
  520.  
  521. FUNCTION {format.book.crossref}
  522. { volume empty$
  523.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  524.       "In "
  525.     }
  526.     { "Volume" volume tie.or.space.connect
  527.       " of " *
  528.     }
  529.   if$
  530.   editor empty$
  531.   editor field.or.null author field.or.null =
  532.   or
  533.     { key empty$
  534.     { series empty$
  535.         { "need editor, key, or series for " cite$ * " to crossref " *
  536.           crossref * warning$
  537.           "" *
  538.         }
  539.         { "{\em " * series * "\/}" * }
  540.       if$
  541.     }
  542.     { key * }
  543.       if$
  544.     }
  545.     { format.crossref.editor * }
  546.   if$
  547.   " \cite{" * crossref * "}" *
  548. }
  549.  
  550. FUNCTION {format.incoll.inproc.crossref}
  551. { editor empty$
  552.   editor field.or.null author field.or.null =
  553.   or
  554.     { key empty$
  555.     { booktitle empty$
  556.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  557.           crossref * warning$
  558.           ""
  559.         }
  560.         { "In {\em " booktitle * "\/}" * }
  561.       if$
  562.     }
  563.     { "In " key * }
  564.       if$
  565.     }
  566.     { "In " format.crossref.editor * }
  567.   if$
  568.   " \cite{" * crossref * "}" *
  569. }
  570.  
  571. FUNCTION {article}
  572. { output.bibitem
  573.   format.authors "author" output.check
  574.   new.block
  575.   format.title "title" output.check
  576.   new.block
  577.   crossref missing$
  578.     { journal emphasize "journal" output.check
  579.       format.vol.num.pages output
  580.       format.date "year" output.check
  581.     }
  582.     { format.article.crossref output.nonnull
  583.       format.pages output
  584.     }
  585.   if$
  586.   new.block
  587.   note output
  588.   fin.entry
  589. }
  590.  
  591. FUNCTION {book}
  592. { output.bibitem
  593.   author empty$
  594.     { format.editors "author and editor" output.check }
  595.     { format.authors output.nonnull
  596.       crossref missing$
  597.     { "author and editor" editor either.or.check }
  598.     'skip$
  599.       if$
  600.     }
  601.   if$
  602.   new.block
  603.   format.btitle "title" output.check
  604.   crossref missing$
  605.     { format.bvolume output
  606.       new.block
  607.       format.number.series output
  608.       new.sentence
  609.       publisher "publisher" output.check
  610.       address output
  611.     }
  612.     { new.block
  613.       format.book.crossref output.nonnull
  614.     }
  615.   if$
  616.   format.edition output
  617.   format.date "year" output.check
  618.   new.block
  619.   note output
  620.   fin.entry
  621. }
  622.  
  623. FUNCTION {booklet}
  624. { output.bibitem
  625.   format.authors output
  626.   new.block
  627.   format.title "title" output.check
  628.   howpublished address new.block.checkb
  629.   howpublished output
  630.   address output
  631.   format.date output
  632.   new.block
  633.   note output
  634.   fin.entry
  635. }
  636.  
  637. FUNCTION {inbook}
  638. { output.bibitem
  639.   author empty$
  640.     { format.editors "author and editor" output.check }
  641.     { format.authors output.nonnull
  642.       crossref missing$
  643.     { "author and editor" editor either.or.check }
  644.     'skip$
  645.       if$
  646.     }
  647.   if$
  648.   new.block
  649.   format.btitle "title" output.check
  650.   crossref missing$
  651.     { format.bvolume output
  652.       format.chapter.pages "chapter and pages" output.check
  653.       new.block
  654.       format.number.series output
  655.       new.sentence
  656.       publisher "publisher" output.check
  657.       address output
  658.     }
  659.     { format.chapter.pages "chapter and pages" output.check
  660.       new.block
  661.       format.book.crossref output.nonnull
  662.     }
  663.   if$
  664.   format.edition output
  665.   format.date "year" output.check
  666.   new.block
  667.   note output
  668.   fin.entry
  669. }
  670.  
  671. FUNCTION {incollection}
  672. { output.bibitem
  673.   format.authors "author" output.check
  674.   new.block
  675.   format.title "title" output.check
  676.   new.block
  677.   crossref missing$
  678.     { format.in.ed.booktitle "booktitle" output.check
  679.       format.bvolume output
  680.       format.number.series output
  681.       format.chapter.pages output
  682.       new.sentence
  683.       publisher "publisher" output.check
  684.       address output
  685.       format.edition output
  686.       format.date "year" output.check
  687.     }
  688.     { format.incoll.inproc.crossref output.nonnull
  689.       format.chapter.pages output
  690.     }
  691.   if$
  692.   new.block
  693.   note output
  694.   fin.entry
  695. }
  696.  
  697. FUNCTION {inproceedings}
  698. { output.bibitem
  699.   format.authors "author" output.check
  700.   new.block
  701.   format.title "title" output.check
  702.   new.block
  703.   crossref missing$
  704.     { format.in.ed.booktitle "booktitle" output.check
  705.       format.bvolume output
  706.       format.number.series output
  707.       format.pages output
  708.       address empty$
  709.     { organization publisher new.sentence.checkb
  710.       organization output
  711.       publisher output
  712.       format.date "year" output.check
  713.     }
  714.     { address output.nonnull
  715.       format.date "year" output.check
  716.       new.sentence
  717.       organization output
  718.       publisher output
  719.     }
  720.       if$
  721.     }
  722.     { format.incoll.inproc.crossref output.nonnull
  723.       format.pages output
  724.     }
  725.   if$
  726.   new.block
  727.   note output
  728.   fin.entry
  729. }
  730.  
  731. FUNCTION {conference} { inproceedings }
  732.  
  733. FUNCTION {manual}
  734. { output.bibitem
  735.   author empty$
  736.     { organization empty$
  737.     'skip$
  738.     { organization output.nonnull
  739.       address output
  740.     }
  741.       if$
  742.     }
  743.     { format.authors output.nonnull }
  744.   if$
  745.   new.block
  746.   format.btitle "title" output.check
  747.   author empty$
  748.     { organization empty$
  749.     { address new.block.checka
  750.       address output
  751.     }
  752.     'skip$
  753.       if$
  754.     }
  755.     { organization address new.block.checkb
  756.       organization output
  757.       address output
  758.     }
  759.   if$
  760.   format.edition output
  761.   format.date output
  762.   new.block
  763.   note output
  764.   fin.entry
  765. }
  766.  
  767. FUNCTION {mastersthesis}
  768. { output.bibitem
  769.   format.authors "author" output.check
  770.   new.block
  771.   format.title "title" output.check
  772.   new.block
  773.   "Master's thesis" format.thesis.type output.nonnull
  774.   school "school" output.check
  775.   address output
  776.   format.date "year" output.check
  777.   new.block
  778.   note output
  779.   fin.entry
  780. }
  781.  
  782. FUNCTION {misc}
  783. { output.bibitem
  784.   format.authors output
  785.   title howpublished new.block.checkb
  786.   format.title output
  787.   howpublished new.block.checka
  788.   howpublished output
  789.   format.date output
  790.   new.block
  791.   note output
  792.   fin.entry
  793.   empty.misc.check
  794. }
  795.  
  796. FUNCTION {phdthesis}
  797. { output.bibitem
  798.   format.authors "author" output.check
  799.   new.block
  800.   format.btitle "title" output.check
  801.   new.block
  802.   "PhD thesis" format.thesis.type output.nonnull
  803.   school "school" output.check
  804.   address output
  805.   format.date "year" output.check
  806.   new.block
  807.   note output
  808.   fin.entry
  809. }
  810.  
  811. FUNCTION {proceedings}
  812. { output.bibitem
  813.   editor empty$
  814.     { organization output }
  815.     { format.editors output.nonnull }
  816.   if$
  817.   new.block
  818.   format.btitle "title" output.check
  819.   format.bvolume output
  820.   format.number.series output
  821.   address empty$
  822.     { editor empty$
  823.     { publisher new.sentence.checka }
  824.     { organization publisher new.sentence.checkb
  825.       organization output
  826.     }
  827.       if$
  828.       publisher output
  829.       format.date "year" output.check
  830.     }
  831.     { address output.nonnull
  832.       format.date "year" output.check
  833.       new.sentence
  834.       editor empty$
  835.     'skip$
  836.     { organization output }
  837.       if$
  838.       publisher output
  839.     }
  840.   if$
  841.   new.block
  842.   note output
  843.   fin.entry
  844. }
  845.  
  846. FUNCTION {techreport}
  847. { output.bibitem
  848.   format.authors "author" output.check
  849.   new.block
  850.   format.title "title" output.check
  851.   new.block
  852.   format.tr.number output.nonnull
  853.   institution "institution" output.check
  854.   address output
  855.   format.date "year" output.check
  856.   new.block
  857.   note output
  858.   fin.entry
  859. }
  860.  
  861. FUNCTION {unpublished}
  862. { output.bibitem
  863.   format.authors "author" output.check
  864.   new.block
  865.   format.title "title" output.check
  866.   new.block
  867.   note "note" output.check
  868.   format.date output
  869.   fin.entry
  870. }
  871.  
  872. FUNCTION {default.type} { misc }
  873.  
  874. MACRO {jan} {"January"}
  875.  
  876. MACRO {feb} {"February"}
  877.  
  878. MACRO {mar} {"March"}
  879.  
  880. MACRO {apr} {"April"}
  881.  
  882. MACRO {may} {"May"}
  883.  
  884. MACRO {jun} {"June"}
  885.  
  886. MACRO {jul} {"July"}
  887.  
  888. MACRO {aug} {"August"}
  889.  
  890. MACRO {sep} {"September"}
  891.  
  892. MACRO {oct} {"October"}
  893.  
  894. MACRO {nov} {"November"}
  895.  
  896. MACRO {dec} {"December"}
  897.  
  898. MACRO {acmcs} {"ACM Computing Surveys"}
  899.  
  900. MACRO {acta} {"Acta Informatica"}
  901.  
  902. MACRO {cacm} {"Communications of the ACM"}
  903.  
  904. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  905.  
  906. MACRO {ibmsj} {"IBM Systems Journal"}
  907.  
  908. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  909.  
  910. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  911.  
  912. MACRO {ieeetcad}
  913.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  914.  
  915. MACRO {ipl} {"Information Processing Letters"}
  916.  
  917. MACRO {jacm} {"Journal of the ACM"}
  918.  
  919. MACRO {jcss} {"Journal of Computer and System Sciences"}
  920.  
  921. MACRO {scp} {"Science of Computer Programming"}
  922.  
  923. MACRO {sicomp} {"SIAM Journal on Computing"}
  924.  
  925. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  926.  
  927. MACRO {tods} {"ACM Transactions on Database Systems"}
  928.  
  929. MACRO {tog} {"ACM Transactions on Graphics"}
  930.  
  931. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  932.  
  933. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  934.  
  935. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  936.  
  937. MACRO {tcs} {"Theoretical Computer Science"}
  938.  
  939. READ
  940.  
  941. FUNCTION {sortify}
  942. { purify$
  943.   "l" change.case$
  944. }
  945.  
  946. INTEGERS { len }
  947.  
  948. FUNCTION {chop.word}
  949. { 's :=
  950.   'len :=
  951.   s #1 len substring$ =
  952.     { s len #1 + global.max$ substring$ }
  953.     's
  954.   if$
  955. }
  956.  
  957. INTEGERS { et.al.char.used }
  958.  
  959. FUNCTION {initialize.et.al.char.used}
  960. { #0 'et.al.char.used :=
  961. }
  962.  
  963. EXECUTE {initialize.et.al.char.used}
  964.  
  965. FUNCTION {format.lab.names}
  966. { 's :=
  967.   s num.names$ 'numnames :=
  968.  
  969.   numnames #1 =
  970.     { s #1 "{vv }{ll}" format.name$ }
  971.     { numnames #2 =
  972.         { s #1 "{vv }{ll }and " format.name$ s #2 "{vv }{ll}" format.name$ *
  973.         }
  974.         { s #1 "{vv }{ll }\bgroup \em et al.\egroup " format.name$ }
  975.       if$
  976.     }
  977.   if$
  978.  
  979. }
  980.  
  981. FUNCTION {author.key.label}
  982. { author empty$
  983.     { key empty$
  984.  
  985.     { cite$ #1 #3 substring$ }
  986.  
  987.     { key #3 text.prefix$ }
  988.       if$
  989.     }
  990.     { author format.lab.names }
  991.   if$
  992. }
  993.  
  994. FUNCTION {author.editor.key.label}
  995. { author empty$
  996.     { editor empty$
  997.     { key empty$
  998.  
  999.         { cite$ #1 #3 substring$ }
  1000.  
  1001.         { key #3 text.prefix$ }
  1002.       if$
  1003.     }
  1004.     { editor format.lab.names }
  1005.       if$
  1006.     }
  1007.     { author format.lab.names }
  1008.   if$
  1009. }
  1010.  
  1011. FUNCTION {author.key.organization.label}
  1012. { author empty$
  1013.     { key empty$
  1014.     { organization empty$
  1015.  
  1016.         { cite$ #1 #3 substring$ }
  1017.  
  1018.         { "The " #4 organization chop.word #3 text.prefix$ }
  1019.       if$
  1020.     }
  1021.     { key #3 text.prefix$ }
  1022.       if$
  1023.     }
  1024.     { author format.lab.names }
  1025.   if$
  1026. }
  1027.  
  1028. FUNCTION {editor.key.organization.label}
  1029. { editor empty$
  1030.     { key empty$
  1031.     { organization empty$
  1032.  
  1033.         { cite$ #1 #3 substring$ }
  1034.  
  1035.         { "The " #4 organization chop.word #3 text.prefix$ }
  1036.       if$
  1037.     }
  1038.     { key #3 text.prefix$ }
  1039.       if$
  1040.     }
  1041.     { editor format.lab.names }
  1042.   if$
  1043. }
  1044.  
  1045. FUNCTION {calc.label}
  1046. { type$ "book" =
  1047.   type$ "inbook" =
  1048.   or
  1049.     'author.editor.key.label
  1050.     { type$ "proceedings" =
  1051.     'editor.key.organization.label
  1052.     { type$ "manual" =
  1053.         'author.key.organization.label
  1054.         'author.key.label
  1055.       if$
  1056.     }
  1057.       if$
  1058.     }
  1059.   if$
  1060.   duplicate$
  1061.  
  1062.   "\protect\citename{" swap$ * ", }" *
  1063.   year field.or.null purify$ *
  1064.   'label :=
  1065.   year field.or.null purify$ *
  1066.  
  1067.   sortify 'sort.label :=
  1068. }
  1069.  
  1070. FUNCTION {sort.format.names}
  1071. { 's :=
  1072.   #1 'nameptr :=
  1073.   ""
  1074.   s num.names$ 'numnames :=
  1075.   numnames 'namesleft :=
  1076.     { namesleft #0 > }
  1077.     { nameptr #1 >
  1078.     { "   " * }
  1079.     'skip$
  1080.       if$
  1081.  
  1082.       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1083.  
  1084.       nameptr numnames = t "others" = and
  1085.     { "et al" * }
  1086.     { t sortify * }
  1087.       if$
  1088.       nameptr #1 + 'nameptr :=
  1089.       namesleft #1 - 'namesleft :=
  1090.     }
  1091.   while$
  1092. }
  1093.  
  1094. FUNCTION {sort.format.title}
  1095. { 't :=
  1096.   "A " #2
  1097.     "An " #3
  1098.       "The " #4 t chop.word
  1099.     chop.word
  1100.   chop.word
  1101.   sortify
  1102.   #1 global.max$ substring$
  1103. }
  1104.  
  1105. FUNCTION {author.sort}
  1106. { author empty$
  1107.     { key empty$
  1108.     { "to sort, need author or key in " cite$ * warning$
  1109.       ""
  1110.     }
  1111.     { key sortify }
  1112.       if$
  1113.     }
  1114.     { author sort.format.names }
  1115.   if$
  1116. }
  1117.  
  1118. FUNCTION {author.editor.sort}
  1119. { author empty$
  1120.     { editor empty$
  1121.     { key empty$
  1122.         { "to sort, need author, editor, or key in " cite$ * warning$
  1123.           ""
  1124.         }
  1125.         { key sortify }
  1126.       if$
  1127.     }
  1128.     { editor sort.format.names }
  1129.       if$
  1130.     }
  1131.     { author sort.format.names }
  1132.   if$
  1133. }
  1134.  
  1135. FUNCTION {author.organization.sort}
  1136. { author empty$
  1137.     { organization empty$
  1138.     { key empty$
  1139.         { "to sort, need author, organization, or key in " cite$ * warning$
  1140.           ""
  1141.         }
  1142.         { key sortify }
  1143.       if$
  1144.     }
  1145.     { "The " #4 organization chop.word sortify }
  1146.       if$
  1147.     }
  1148.     { author sort.format.names }
  1149.   if$
  1150. }
  1151.  
  1152. FUNCTION {editor.organization.sort}
  1153. { editor empty$
  1154.     { organization empty$
  1155.     { key empty$
  1156.         { "to sort, need editor, organization, or key in " cite$ * warning$
  1157.           ""
  1158.         }
  1159.         { key sortify }
  1160.       if$
  1161.     }
  1162.     { "The " #4 organization chop.word sortify }
  1163.       if$
  1164.     }
  1165.     { editor sort.format.names }
  1166.   if$
  1167. }
  1168.  
  1169. FUNCTION {presort}
  1170.  
  1171. { calc.label
  1172.   sort.label
  1173.   "    "
  1174.   *
  1175.   type$ "book" =
  1176.  
  1177.   type$ "inbook" =
  1178.   or
  1179.     'author.editor.sort
  1180.     { type$ "proceedings" =
  1181.     'editor.organization.sort
  1182.     { type$ "manual" =
  1183.         'author.organization.sort
  1184.         'author.sort
  1185.       if$
  1186.     }
  1187.       if$
  1188.     }
  1189.   if$
  1190.  
  1191.   *
  1192.  
  1193.   "    "
  1194.   *
  1195.   year field.or.null sortify
  1196.   *
  1197.   "    "
  1198.   *
  1199.   title field.or.null
  1200.   sort.format.title
  1201.   *
  1202.   #1 entry.max$ substring$
  1203.   'sort.key$ :=
  1204. }
  1205.  
  1206. ITERATE {presort}
  1207.  
  1208. SORT
  1209.  
  1210. STRINGS { longest.label last.sort.label next.extra }
  1211.  
  1212. INTEGERS { longest.label.width last.extra.num }
  1213.  
  1214. FUNCTION {initialize.longest.label}
  1215. { "" 'longest.label :=
  1216.   #0 int.to.chr$ 'last.sort.label :=
  1217.   "" 'next.extra :=
  1218.   #0 'longest.label.width :=
  1219.   #0 'last.extra.num :=
  1220. }
  1221.  
  1222. FUNCTION {forward.pass}
  1223. { last.sort.label sort.label =
  1224.     { last.extra.num #1 + 'last.extra.num :=
  1225.       last.extra.num int.to.chr$ 'extra.label :=
  1226.     }
  1227.     { "a" chr.to.int$ 'last.extra.num :=
  1228.       "" 'extra.label :=
  1229.       sort.label 'last.sort.label :=
  1230.     }
  1231.   if$
  1232. }
  1233.  
  1234. FUNCTION {reverse.pass}
  1235. { next.extra "b" =
  1236.     { "a" 'extra.label := }
  1237.     'skip$
  1238.   if$
  1239.   label extra.label * 'label :=
  1240.   label width$ longest.label.width >
  1241.     { label 'longest.label :=
  1242.       label width$ 'longest.label.width :=
  1243.     }
  1244.     'skip$
  1245.   if$
  1246.   extra.label 'next.extra :=
  1247. }
  1248.  
  1249. EXECUTE {initialize.longest.label}
  1250.  
  1251. ITERATE {forward.pass}
  1252.  
  1253. REVERSE {reverse.pass}
  1254.  
  1255. FUNCTION {begin.bib}
  1256.  
  1257. { et.al.char.used
  1258.     { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1259.     'skip$
  1260.   if$
  1261.   preamble$ empty$
  1262.  
  1263.     'skip$
  1264.     { preamble$ write$ newline$ }
  1265.   if$
  1266.  
  1267.   "\begin{thebibliography}{" "}" * write$ newline$
  1268.  
  1269. }
  1270.  
  1271. EXECUTE {begin.bib}
  1272.  
  1273. EXECUTE {init.state.consts}
  1274.  
  1275. ITERATE {call.type$}
  1276.  
  1277. FUNCTION {end.bib}
  1278. { newline$
  1279.   "\end{thebibliography}" write$ newline$
  1280. }
  1281.  
  1282. EXECUTE {end.bib}
  1283.